'use strict'

var Router = require('koa-router')
var App = require('../app/controllers/app')
var List = require('../app/controllers/list')
var Detail = require('../app/controllers/detail')
var Op = require('../app/controllers/op')
var User = require('../app/controllers/user')

module.exports = function () {
  var router = new Router({
    prefix: '/api'
  })

  router.get('/tai/list', List.list)
  router.get('/tai/detail', Detail.findOne)
  router.get('/tai/gathered', Op.gathered)

  // user
  router.post('/user/login', User.login)
  router.get('/user/logout', User.login)
  router.get('/user', User.user)
  router.get('/menus', User.menu)

  return router
}
